Skip to content

chore(OVH): delete environment when it gets tear down - #441

Open
acolombier wants to merge 1 commit into
mixxxdj:websitefrom
acolombier:chore/delete-env-when-tearing-down
Open

chore(OVH): delete environment when it gets tear down#441
acolombier wants to merge 1 commit into
mixxxdj:websitefrom
acolombier:chore/delete-env-when-tearing-down

Conversation

@acolombier

@acolombier acolombier commented Jul 29, 2026

Copy link
Copy Markdown
Member

Correctly clean up the active environment view: https://github.com/mixxxdj/website/deployments

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the OVH deployment reusable workflow to better reflect deploy vs teardown activity and attempts to clean up GitHub “Environments” metadata after a teardown so the deployments/environments UI doesn’t retain stale preview environments.

Changes:

  • Add a dynamic job name in the reusable OVH workflow to clearly indicate Deploying vs Tearing down.
  • Add a teardown-only step that calls the GitHub REST API to delete the corresponding environment.
  • Expand permissions for the cleanup job in deploy.yml to support the new teardown behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/ovh.yaml Adds dynamic job naming and a teardown step intended to delete the GitHub Environment via REST API.
.github/workflows/deploy.yml Adds explicit job permissions for the cleanup/teardown reusable-workflow invocation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +133 to +148
- name: Deleting environment
if: ${{ inputs.action == 'teardown' && inputs.target != 'www' }}
env:
ENVIRONMENT_NAME: ${{ inputs.environment_name }}
uses: actions/github-script@v9
with:
script: |
const environment = process.env.ENVIRONMENT_NAME;

try {

await github.rest.repos.deleteAnEnvironment({
owner: context.repo.owner,
repo: context.repo.repo,
environment_name: environment,
});
Comment thread .github/workflows/deploy.yml Outdated
Comment on lines +23 to +26
permissions:
contents: read
deployments: write
actions: write
@acolombier
acolombier force-pushed the chore/delete-env-when-tearing-down branch from 5b858d7 to 6e7b9a5 Compare July 29, 2026 22:55
@acolombier

Copy link
Copy Markdown
Member Author

Hmmm I was under the impression that deployments: write would be enough but on second look, it does need elevated permission, which only a PAT can grant.

I have set a dedicated PAT from @mixxxbot, I will grant it access once my access is sorted, as requested on Zulip.

@acolombier

Copy link
Copy Markdown
Member Author

Added @mixxxbot as admin on the project, should be good to go now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants